package com.albaba.designpattern.proxy.text_003;

import java.util.Collection;

/**
 * @Description: TODO
 * @Author zx
 * @Date 2025/2/20 15:29
 * @Version 1.0
 */
public class TextProxy {

    public static void main(String[] args) {
        // 目标对象
        UserServiceImpl userService = new UserServiceImpl();
        System.out.println(userService.getClass());

        // 代理对象
        UserServiceImpl proxy = (UserServiceImpl) new UserLogProxy().getLogProxy(userService);

        System.out.println(proxy.getClass());

        Collection<User> userList = proxy.findUserList();
        for (User user : userList) {
            System.out.println(user);
        }
    }
}
